package com.ice.work.organization.user.controller;

import cn.hutool.core.lang.Assert;
import com.honeybee.cloud.framework.base.exception.business.BaseBizException;
import com.honeybee.cloud.framework.common.response.ResponseEntity;
import com.ice.work.organization.user.service.IUserService;
import com.ice.work.organization.facadeuser.controller.IUserController;
import com.ice.work.organization.facadeuser.model.User;
import com.ice.work.organization.facadeuser.request.AddUserRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 用户
 * @Author DELL
 * @Create 2019-09-29
 * @Since 1.0.0
 */
@RestController
@Slf4j
public class UserController implements IUserController {

    private final IUserService userService;

    @Autowired
    public UserController(IUserService userService) {
        Assert.notNull(userService, "userService not null");
        this.userService = userService;
    }

    @Override
    public ResponseEntity<Void> addUser(AddUserRequest request) throws BaseBizException {
        userService.addUser(new User());
        return ResponseEntity.ok(request);
    }

    @Override
    public ResponseEntity<Void> getUser() throws BaseBizException {
        log.info("测试");
        return ResponseEntity.ok();
    }
}
